From 3fb3c15ab916c421c378e12ce104f58adb6d035c Mon Sep 17 00:00:00 2001 From: "Matteo F. Vescovi" Date: Fri, 13 Feb 2015 12:22:12 +0100 Subject: [PATCH] Imported Upstream version 0.1.12 --- AUTHORS | 24 + INSTALL | 10 +- Makefile.am | 8 +- Makefile.in | 81 +- NEWS | 6 +- README | 939 +++++- aclocal.m4 | 171 +- babl/Makefile.am | 51 +- babl/Makefile.in | 207 +- babl/babl-conversion.c | 30 +- babl/babl-cpuaccel.c | 4 + babl/babl-cpuaccel.h | 3 +- babl/babl-extension.c | 6 +- babl/babl-fish-path.c | 242 +- babl/babl-fish-reference.c | 127 +- babl/babl-fish-stats.c | 4 +- babl/babl-format.c | 38 +- babl/babl-ids.h | 5 + babl/babl-internal.h | 66 +- babl/babl-introspect.c | 13 + babl/babl-list.h | 5 +- babl/babl-memory.c | 4 +- babl/babl-model.c | 25 +- babl/babl-palette.c | 2 +- babl/babl-ref-pixels.c | 81 + babl/babl-ref-pixels.h | 34 + babl/babl-ref-pixels.inc | 1356 +++++++++ babl/babl-type.c | 34 +- babl/babl-types.h | 7 +- babl/babl-util.c | 39 +- babl/babl-util.h | 6 +- babl/babl-version.h | 2 +- babl/babl.c | 102 +- babl/babl.h | 69 +- babl/base/Makefile.am | 6 +- babl/base/Makefile.in | 66 +- babl/base/babl-base.c | 4 + babl/base/babl-base.h | 2 + babl/base/model-gray.c | 112 + babl/base/model-rgb.c | 160 + babl/base/pow-24.c | 73 + babl/base/pow-24.h | 25 + babl/base/rgb-constants.h | 29 +- babl/base/type-half.c | 344 +++ babl/base/type-u15.c | 136 + babl/base/util.h | 44 +- config.h.in | 3 + config.sub | 11 +- configure | 2621 +++++++---------- configure.ac | 105 +- depcomp | 124 +- docs/Makefile.in | 62 +- docs/graphics/Makefile.am | 4 +- docs/graphics/Makefile.in | 55 +- docs/index-static.html.in | 9 +- extensions/CIE.c | 1042 +++---- extensions/HSL.c | 287 ++ extensions/HSV.c | 357 +++ extensions/Makefile.am | 30 +- extensions/Makefile.in | 208 +- extensions/cairo-tables.h | 5027 ++++++++++++++++++++++++++++++++ extensions/cairo.c | 142 +- extensions/float.c | 42 +- extensions/gegl-fixups.c | 71 +- extensions/gggl-lies.c | 872 +----- extensions/gggl.c | 891 ++---- extensions/grey.c | 137 + extensions/naive-CMYK.c | 117 +- extensions/simple.c | 164 ++ extensions/sse-fixups.c | 243 -- extensions/sse2-float.c | 658 +++++ extensions/sse2-int16.c | 214 ++ extensions/sse2-int8.c | 280 ++ extensions/two-table-tables.h | 3444 ++++++++++++++++++++++ extensions/two-table.c | 233 ++ extensions/ycbcr.c | 258 ++ ltmain.sh | 4 +- m4/introspection.m4 | 94 - m4/libtool.m4 | 28 +- tests/Makefile.am | 18 +- tests/Makefile.in | 170 +- tests/babl_fish_path_fitness.c | 5 + tests/cairo-RGB24.c | 95 + tests/common.inc | 27 + tests/extract.c | 118 +- tests/float-to-8bit.c | 102 + tests/floatclamp.c | 46 + tests/grayscale_to_rgb.c | 3 +- tests/hsl.c | 111 + tests/hsva.c | 116 + tests/n_components_cast.c | 97 + tests/palette.c | 29 +- tests/srgb_to_lab_u8.c | 8 +- tools/Makefile.am | 9 + tools/Makefile.in | 551 ++++ tools/babl-gen-test-pixels.c | 164 ++ 96 files changed, 18913 insertions(+), 5395 deletions(-) create mode 100644 babl/babl-ref-pixels.c create mode 100644 babl/babl-ref-pixels.h create mode 100644 babl/babl-ref-pixels.inc create mode 100644 babl/base/pow-24.c create mode 100644 babl/base/pow-24.h create mode 100644 babl/base/type-half.c create mode 100644 babl/base/type-u15.c create mode 100644 extensions/HSL.c create mode 100644 extensions/HSV.c create mode 100644 extensions/cairo-tables.h create mode 100644 extensions/grey.c create mode 100644 extensions/simple.c delete mode 100644 extensions/sse-fixups.c create mode 100644 extensions/sse2-float.c create mode 100644 extensions/sse2-int16.c create mode 100644 extensions/sse2-int8.c create mode 100644 extensions/two-table-tables.h create mode 100644 extensions/two-table.c create mode 100644 extensions/ycbcr.c delete mode 100644 m4/introspection.m4 create mode 100644 tests/cairo-RGB24.c create mode 100644 tests/common.inc create mode 100644 tests/float-to-8bit.c create mode 100644 tests/floatclamp.c create mode 100644 tests/hsl.c create mode 100644 tests/hsva.c create mode 100644 tests/n_components_cast.c create mode 100644 tools/Makefile.am create mode 100644 tools/Makefile.in create mode 100644 tools/babl-gen-test-pixels.c diff --git a/AUTHORS b/AUTHORS index ec8d031..53f5774 100644 --- a/AUTHORS +++ b/AUTHORS @@ -38,5 +38,29 @@
Initial work to make babl threadsafe
Rupert Weber gimp at leguanease.org
Documentation and other improvements
+
Jehan jehan at girinstud.io
+
win32 portabilitiy
+
Sven Claussner
+
Update DOAP file
+
Alexander Larsson
+
Math optimizations
+
Nils Philippsen
+
code cleanups
+
Simon Budig
+
cleanups
+
Micheal Muré +
portability fixes
+ +
Maxime Nicco
+
HSV color model extension
+
Teo Mazars
+
Color spaces/models in extensions
+
Daniel Sabo
+
Dead code elimination, general cleanups,
+
Michael Henning
+
Conversion fixes
+
Elle Stone
+
Verification and improvements to accuracy of color space + conversions.
diff --git a/INSTALL b/INSTALL index 7992295..18e0567 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,5 @@ -babl 0.1.10 +babl 0.1.12 Dynamic; any to any, pixel format conversion library. @@ -12,10 +12,10 @@ From a released version the following is the expected method of installation (or a variation on this theme): ------------------------------------------------------------ - foo$ wget ftp://ftp.gtk.org/pub/babl/0.1/babl-0.1.10.tar.bz2 - foo$ tar jxf babl-0.1.10.tar.gz - foo$ cd babl-0.1.10 - foo/babl-0.1.10$ ./configure && make && sudo make install + foo$ wget ftp://ftp.gtk.org/pub/babl/0.1/babl-0.1.12.tar.bz2 + foo$ tar jxf babl-0.1.12.tar.gz + foo$ cd babl-0.1.12 + foo/babl-0.1.12$ ./configure && make && sudo make install ------------------------------------------------------------ diff --git a/Makefile.am b/Makefile.am index 19df326..e46014c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,11 +1,14 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -#DISTCHECK_CONFIGURE_FLAGS = --enable-introspection SUBDIRS = \ babl \ extensions \ tests \ - docs + tools + +if ENABLE_DOCS +SUBDIRS+= docs +endif pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = babl.pc @@ -20,7 +23,6 @@ EXTRA_DIST = \ NEWS \ TODO \ autogen.sh \ - m4/introspection.m4 \ babl.pc.in DISTCLEANFILES = \ diff --git a/Makefile.in b/Makefile.in index ee7ae61..a14cbfc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -16,6 +16,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -34,6 +51,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ +@ENABLE_DOCS_TRUE@am__append_1 = docs subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/INSTALL.in \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ @@ -42,11 +61,10 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/INSTALL.in \ TODO config.guess config.sub depcomp install-sh ltmain.sh \ missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -70,6 +88,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -106,7 +129,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) +DIST_SUBDIRS = babl extensions tests tools docs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -193,14 +216,6 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ -INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ -INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ -INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ -INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ -INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ -INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ -INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -230,18 +245,15 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEP = @PATH_SEP@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ RSVG = @RSVG@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHREXT = @SHREXT@ +SSE2_EXTRA_CFLAGS = @SSE2_EXTRA_CFLAGS@ SSE_EXTRA_CFLAGS = @SSE_EXTRA_CFLAGS@ STRIP = @STRIP@ -VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ W3M = @W3M@ WEBSITE_HOST = @WEBSITE_HOST@ @@ -294,18 +306,16 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -#DISTCHECK_CONFIGURE_FLAGS = --enable-introspection -SUBDIRS = \ - babl \ - extensions \ - tests \ - docs - +SUBDIRS = babl extensions tests tools $(am__append_1) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = babl.pc built_dist_files = README @@ -317,7 +327,6 @@ EXTRA_DIST = \ NEWS \ TODO \ autogen.sh \ - m4/introspection.m4 \ babl.pc.in DISTCLEANFILES = \ @@ -392,8 +401,11 @@ distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -578,13 +590,10 @@ distdir: $(DISTFILES) done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -669,7 +678,7 @@ distcheck: dist *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) + chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) diff --git a/NEWS b/NEWS index a123cc3..d94336b 100644 --- a/NEWS +++ b/NEWS @@ -5,7 +5,11 @@ the news section both in the README and the webpage. --> -2012-03-30 babl-0.1.8
+2012-03-30 babl-0.1.12
+optimizations for floating point conversions, HSV and HSL color models, +removal of dead code, fixed CIE Lab conversions. +
+2012-03-30 babl-0.1.10
LUT based speedups for gamma correction / uncorrection.
2012-03-30 babl-0.1.8
diff --git a/README b/README index 1583b95..99096bb 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Babl-0.1.10 +Babl-0.1.12 Contents @@ -59,7 +59,10 @@ babl release. If there are significant improvements to babl when a GEGL release is done a babl release is most often put out just prior to the GEGL release. -2012-03-30 babl-0.1.8 +2012-03-30 babl-0.1.12 + optimizations for floating point conversions, HSV and HSL color + models, removal of dead code, fixed CIE Lab conversions. +2012-03-30 babl-0.1.10 LUT based speedups for gamma correction / uncorrection. 2012-03-30 babl-0.1.8 Added support for indexed/pallette based formats, constified API. @@ -131,9 +134,9 @@ of pixels, with different pixel formats. int width = 123, height = 581, pixel_count = width * height; -const Babl *srgb = babl_format ("R'G'B' u8"); -const Babl *lab = babl_format ("CIE Lab float"); -Babl *rgb_to_lab_fish = babl_fish (srgb, lab); +const Babl *srgb = babl_format ("R'G'B' u8"); +const Babl *lab = babl_format ("CIE Lab float"); +const Babl *srgb_to_lab_fish = babl_fish (srgb, lab); float *lab_buffer; unsigned char *srgb_buffer; @@ -145,7 +148,7 @@ lab_buffer = malloc (pixel_count * 3 * sizeof (float)); ...... load data into srgb_buffer ....... -babl_process (rgb_to_lab_fish, srgb_buffer, lab_buffer, pixel_count); +babl_process (srgb_to_lab_fish, srgb_buffer, lab_buffer, pixel_count); ...... do operation in lab space ........ @@ -177,6 +180,20 @@ bits bytes 8 +u15 + +bits + 16 +bytes + 2 + +half + +bits + 16 +bytes + 2 + float bits @@ -391,6 +408,23 @@ components CIE H(ab) A +HSVA + +components + + hue + saturation + value + alpha + +HSV + +components + + hue + saturation + value + CMYK components @@ -400,6 +434,48 @@ components yellow key +CMY + +components + + cyan + magenta + yellow + +Y'CbCr709 + +components + + Y' + Cb + Cr + +Y'CbCrA709 + +components + + Y' + Cb + Cr + alpha + +HSLA + +components + + hue + saturation + lightness + alpha + +HSL + +components + + hue + saturation + lightness + Pixel formats RGBA double @@ -527,6 +603,234 @@ components float G float B +RGB half + +bytes/pixel + 6 +model + RGB +components + + half R + half G + half B + +RGBA half + +bytes/pixel + 8 +model + RGBA +components + + half R + half G + half B + half A + +RaGaBaA half + +bytes/pixel + 8 +model + RaGaBaA +components + + half Ra + half Ga + half Ba + half A + +R'G'B' half + +bytes/pixel + 6 +model + R'G'B' +components + + half R' + half G' + half B' + +R'G'B'A half + +bytes/pixel + 8 +model + R'G'B'A +components + + half R' + half G' + half B' + half A + +R'aG'aB'aA half + +bytes/pixel + 8 +model + R'aG'aB'aA +components + + half R'a + half G'a + half B'a + half A + +RGB u15 + +bytes/pixel + 6 +model + RGB +components + + u15 R + u15 G + u15 B + +RGBA u15 + +bytes/pixel + 8 +model + RGBA +components + + u15 R + u15 G + u15 B + u15 A + +RaGaBaA u15 + +bytes/pixel + 8 +model + RaGaBaA +components + + u15 Ra + u15 Ga + u15 Ba + u15 A + +R'G'B' u15 + +bytes/pixel + 6 +model + R'G'B' +components + + u15 R' + u15 G' + u15 B' + +R'G'B'A u15 + +bytes/pixel + 8 +model + R'G'B'A +components + + u15 R' + u15 G' + u15 B' + u15 A + +R'aG'aB'aA u15 + +bytes/pixel + 8 +model + R'aG'aB'aA +components + + u15 R'a + u15 G'a + u15 B'a + u15 A + +RGB u32 + +bytes/pixel + 12 +model + RGB +components + + u32 R + u32 G + u32 B + +RGBA u32 + +bytes/pixel + 16 +model + RGBA +components + + u32 R + u32 G + u32 B + u32 A + +RaGaBaA u32 + +bytes/pixel + 16 +model + RaGaBaA +components + + u32 Ra + u32 Ga + u32 Ba + u32 A + +R'G'B' u32 + +bytes/pixel + 12 +model + R'G'B' +components + + u32 R' + u32 G' + u32 B' + +R'G'B'A u32 + +bytes/pixel + 16 +model + R'G'B'A +components + + u32 R' + u32 G' + u32 B' + u32 A + +R'aG'aB'aA u32 + +bytes/pixel + 16 +model + R'aG'aB'aA +components + + u32 R'a + u32 G'a + u32 B'a + u32 A + Y double bytes/pixel @@ -591,6 +895,198 @@ components double Y'a double A +YA half + +bytes/pixel + 4 +model + YA +components + + half Y + half A + +YaA half + +bytes/pixel + 4 +model + YaA +components + + half Ya + half A + +Y half + +bytes/pixel + 2 +model + Y +components + + half Y + +Y'A half + +bytes/pixel + 4 +model + Y'A +components + + half Y' + half A + +Y'aA half + +bytes/pixel + 4 +model + Y'aA +components + + half Y'a + half A + +Y' half + +bytes/pixel + 2 +model + Y' +components + + half Y' + +YA u15 + +bytes/pixel + 4 +model + YA +components + + u15 Y + u15 A + +YaA u15 + +bytes/pixel + 4 +model + YaA +components + + u15 Ya + u15 A + +Y u15 + +bytes/pixel + 2 +model + Y +components + + u15 Y + +Y'A u15 + +bytes/pixel + 4 +model + Y'A +components + + u15 Y' + u15 A + +Y'aA u15 + +bytes/pixel + 4 +model + Y'aA +components + + u15 Y'a + u15 A + +Y' u15 + +bytes/pixel + 2 +model + Y' +components + + u15 Y' + +YA u32 + +bytes/pixel + 8 +model + YA +components + + u32 Y + u32 A + +YaA u32 + +bytes/pixel + 8 +model + YaA +components + + u32 Ya + u32 A + +Y u32 + +bytes/pixel + 4 +model + Y +components + + u32 Y + +Y'A u32 + +bytes/pixel + 8 +model + Y'A +components + + u32 Y' + u32 A + +Y'aA u32 + +bytes/pixel + 8 +model + Y'aA +components + + u32 Y'a + u32 A + +Y' u32 + +bytes/pixel + 4 +model + Y' +components + + u32 Y' + Y'CbCr double bytes/pixel @@ -1147,18 +1643,55 @@ components float CIE H(ab) float A -cairo-ARGB32 +HSVA double bytes/pixel - 4 + 32 model - R'aG'aB'aA + HSVA components - u8 B'a - u8 G'a - u8 R'a - u8 A + double hue + double saturation + double value + double alpha + +HSV double + +bytes/pixel + 24 +model + HSV +components + + double hue + double saturation + double value + +HSVA float + +bytes/pixel + 16 +model + HSVA +components + + float hue + float saturation + float value + float alpha + +HSV float + +bytes/pixel + 12 +model + HSV +components + + float hue + float saturation + float value cairo-RGB24 @@ -1173,6 +1706,19 @@ components u8 R' u8 PAD +cairo-ARGB32 + +bytes/pixel + 4 +model + R'aG'aB'aA +components + + u8 B'a + u8 G'a + u8 R'a + u8 A + cairo-A8 bytes/pixel @@ -1196,6 +1742,18 @@ components double yellow double key +CMY double + +bytes/pixel + 24 +model + CMY +components + + double cyan + double magenta + double yellow + CMYK float bytes/pixel @@ -1205,10 +1763,85 @@ model components float cyan - float yellow float magenta + float yellow float key +CMY float + +bytes/pixel + 12 +model + CMY +components + + float cyan + float magenta + float yellow + +CMYK u8 + +bytes/pixel + 4 +model + CMYK +components + + u8 cyan + u8 magenta + u8 yellow + u8 key + +Y'CbCr709 double + +bytes/pixel + 24 +model + Y'CbCr709 +components + + double Y' + double Cb + double Cr + +Y'CbCrA709 double + +bytes/pixel + 32 +model + Y'CbCrA709 +components + + double Y' + double Cb + double Cr + double alpha + +Y'CbCrA709 float + +bytes/pixel + 16 +model + Y'CbCrA709 +components + + float Y' + float Cb + float Cr + float alpha + +Y'CbCr709 float + +bytes/pixel + 12 +model + Y'CbCr709 +components + + float Y' + float Cb + float Cr + B'aG'aR'aA u8 bytes/pixel @@ -1222,6 +1855,56 @@ components u8 R'a u8 A +HSLA double + +bytes/pixel + 32 +model + HSLA +components + + double hue + double saturation + double lightness + double alpha + +HSL double + +bytes/pixel + 24 +model + HSL +components + + double hue + double saturation + double lightness + +HSLA float + +bytes/pixel + 16 +model + HSLA +components + + float hue + float saturation + float lightness + float alpha + +HSL float + +bytes/pixel + 12 +model + HSL +components + + float hue + float saturation + float lightness + Shortcut Coverage The diagram shown below visualizes the coverage of current shortcut @@ -1230,80 +1913,131 @@ height of the bar indicates the number of conversions steps needed in a chain of conversions. A DHTML version is also available. - ··▂▂·▁·· ··· ▁ ▁ ▂ ▁▁ ▁ ···· · ── 0 RGBA double - ── 1 RGB double - ── 2 RaGaBaA double - ── 3 R'G'B' double -· ▁▁▁▁▂▁▁ ▁▁▁ · ▂ ▁ ▂▂ ▂ ▁▁▁▁ ▁ ── 4 R'G'B'A double -· ▃▃▁▂▁▁ ▁▁▁ ▂ ▃ ▂▂ ▂ ▁▁▁▁ ▁ ── 5 R'aG'aB'aA double -▂ ▂ ··▂▃▃ ▂▃▂ ▁ ▁ ·· ▁▂ ▃ ▂ ▂▂▃▃ ▃ ── 6 R'G'B' u8 -▁ ▁▂ ·▁▃▂ ▃▃▂ · ▁ ▁ ▁▁ ▁ ▂▂▃▂ ▃ ── 7 R'G'B'A u8 -· ▁▁▁ ·▁▁ ▁▁▁ ▂ · ▁ ·· · ▁▁▁▁ ▁ ── 8 RGBA float -▁ ▂▂▂▂ ▂▂ ▂▂▂ ▃ ▁ ▃· ▁· ▂ ▁ ▂▃▂▂ ▂ ── 9 RGB float -· ▁▁▃▃▁ ▁ ▁▁▁ ▂ ▃ ▃ ▂▂ ▃ ▂ ▁▁▁▁ ▁ ──10 Y double -· ▁▁▃▃▁▂ ▁▁▁ ▂ ▂ ▃ ▂▂ ▂ ▁▁▁▁ ▁ ──11 YA double - ──12 YaA double - ──13 Y' double - ──14 Y'A double -· ▁▁▃▃▁▂▁▁ ▁▁ ▂ ▂ ▃ ▂▂ ▂ ▁▁▁▁ ▁ ──15 Y'aA double -· ▁▁▃▃▁▂▁▁ ▁ ▂ ▃ ▃ ▃▂ ▃ ▂ ▁▁▁▁ ▁ ──16 Y'CbCr double - ▁▁▃▃▁▂▁▁ ▁ ▂ ▂ ▃ ▂▂ ▂ ▁▁▁▁ ▁ ──17 Y'CbCrA double - ──18 Y'CbCr u8 -▁ ·▂···▁▂▂ ▃▂▂ ▁ · ▁▁ ▃ ▂▂▂▂ ▂ ──19 R'G'B'A float -▂ ▁▃▁▁▁▂▃▃ ▃▃▃ ▁ ▁ ▂▂ ▃ ▃▃▃▃ ▃ ──20 R'G'B'A u16 - ▁▁ ▂ ▃ ▃▃▃▃ ──21 R'aG'aB'aA float -▃ ▂ ▂▃ ▁ ▂ ▃▃ ▃ ──22 R'aG'aB'aA u16 -▃ ▂ ▂▃ ▁ · ▂ ▃▃ ▃ ──23 R'aG'aB'aA u8 -▃ ▁▃▁▁▁▃▃▃ ▃▃▃ · · ▃▃ ▃ ▃ ▃▃▃▃ ▃ ──24 R'G'B' float -▃ ▂ ▂▃▃▁ ▁ ▁ ▃ ▃▃ ▃ ──25 R'G'B' u16 - ▁ ▃▁ · ▁ ▁ ·· ▂ ▁ ──26 Y'A float - ▂ ▂▂ ▁ · ▂ ▁ ▁ · ──27 Y'aA float - ▂ ▂▂ ▁ ▂ ▃▃ · ──28 Y' float - ▂ ▂▂ ▁ ▂ ▂ ·▁ ▃ ▂ ──29 Y'A u16 - ▃ ▃▃ ▂ ▁ ▃ ▁·▂ ▁ ──30 Y'aA u16 - ▃ ▃▃ ▃ ▂ ▁ ▁▁· ──31 Y' u16 -▂ ▂▂▂▂▁▁▃▃ ▂▃▂ ▁ ▂ ▂ ·▁▁ ▃ ▃ ▂▂ ▁·▁▁ ▂▃▂▂ ▂ ──32 Y'A u8 - ▃ ▂ ▁ ▃ ▁·▂ · ──33 Y'aA u8 -▃ ▃▂▃▃▃▃▂▂ ▂▂▂ ▂ ▂ ▃▁ ▁▁· ▃▃ ▂ ▁▁▂· ▂▂▂▂ ▂ ──34 Y' u8 -▃ ▂ ▂▂▃▁ ▁ ▁ ▃· ▃▃ ▃ ──35 Y'CbCr float -▂ ▁▃▁▁▁▂▃▃ ▃▃ · ▂ ▁ ▂▂ ▃ ▃▃▃▃ ▃ ──36 Y'CbCrA float -▁ ▂▂▂▂·▁▂▂ ▂▂▂ ▁ ▁ ▂ ▁▁ ▁ ▂▂▂▂ ▂ ──37 RGBA u16 -▁ ▂▂▂▂·▁▂▂ ▂▂▂ ▁ ▁ ▂ ▁ · ▃▂▂▂ ▂ ──38 RGBA u8 -▁ ▂▂▂▂·▁▂▂ ▂▂▂ ▁ ▁ ▂ ▁ ▂▂▂▂ ▂ ──39 RaGaBaA float -▂ ▃▃▃▃▁▂▃▃ ▃▃▃ ▂ ▂ ▃ ▂ ▂ ▃▃▃▃ ▃ ──40 RaGaBaA u16 -▂ ▃▃▃▃▁▂▃▃ ▃▃▃ ▂ ▂ ▃ · ▃▃▃▃ ▃ ──41 RaGaBaA u8 -▂ ▃▃▃▃▁·▃▃ ▃▃▃ ▂ ▃ ▁ ▃▂ ▂ ▃▃▃▃ ▃ ──42 RGB u16 -▁ ▂▃▃▃▁·▂▃ ▃▃▂ ▂ ▃ ▃▁ ·▁ · ▃▃▃▃ ▃ ──43 RGB u8 -▁ ▂▂▂▂·▁▂ ▂▂▂ ▁ ▁ ▂ ▁▁ ·· ▂▂▂▂ ▂ ──44 YA float -▂ ▃▃▃▃▁▂▃▃ ▃▃▃ ▂ ▂ ▃ ▂· ▂ ▃▃▃▃ ▃ ──45 YaA float -▂ ▃▃▃▃▃▂ ▃ ▃▃▃ ▂ ▂ ▃ ▂▂ ▃ ▂· ▃▃▃▃ ▃ ──46 Y float -▂ ▃▃▃▃▁▂▃▃ ▃▃▃ ▂ ▂ ▃ ▂▂ ▂·▁ ▃▃▃▃ ▃ ──47 YA u16 -▃ ▂▃ ▃ ▃ ▃▁ ▃ · ──48 YaA u16 -▃ ▂▁ ▃ ▃ ▂ ▃▂ ▃▁▁· ──49 Y u16 -▁ ▃▃▃▃·▂▃▃ ▃▃▃ ▁ ▁ ▂ ▂▂ ▁·▁▁ ▃▂▃▃ ▂ ──50 YA u8 -▃ ▂▃ ▃ ▃ ▁ ▁·▂ ──51 YaA u8 -▁ ▂▂▂▃▂▁▂▂ ▂▂▂ ▁ ▃ ▃▂ ▃▃ ▂ ▃▁▁· ▂▂▂▂ ▂ ──52 Y u8 -· ▁▁▃▃▁▂▁▁ ▁▁▁ ▂ ▃ ▃ ▂▂ ▃ ▂ ▁▁▁ ▁ ──53 CIE Lab double -· ▁▁▃▃▁▂▁▁ ▁▁▁ ▂ ▂ ▃ ▂▂ ▂ ▁ ▁ ──54 CIE Lab alpha double -· ▁▁▃▃▁▂▁▁ ▁▁▁ ▂ ▃ ▃ ▂▂ ▃ ▂ ▁ ▁ ▁ ──55 CIE LCH(ab) double -· ▁▁▃▃▁▂▁▁ ▁▁▁ ▂ ▂ ▃ ▂▂ ▂ ▁▁ ▁ ──56 CIE LCH(ab) alpha double - ──57 CIE Lab float - ──58 CIE Lab alpha float - ──59 CIE Lab u8 - ──60 CIE Lab u16 - ──61 CIE LCH(ab) float - ──62 CIE LCH(ab) alpha float - ──63 cairo-ARGB32 - ──64 cairo-RGB24 - ──65 cairo-A8 -· ▁▁▃▃▁▂▁▁ ▁▁▁ ▂ ▃ ▃ ▃▂ ▃ ▂ ▁▁▁▁ ──66 CMYK double - ──67 CMYK float - ──68 B'aG'aR'aA u8 -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -||||||||||11111111112222222222333333333344444444445555555555666666666 -012345678901234567890123456789012345678901234567890123456789012345678 -total length: 2751 -total cost : 504960 + ▂·▁▂·▁ ·· · ·· ▁▂▂▃▃▂ ▂▃▂ ▃ ▃ ▁▁▁▂▂ ▂▁▂▁ ▂ ▂···· ·· ▁▁ ·· ·· ·· ── 0 RGBA double + ── 1 RGB double + ── 2 RaGaBaA double + ── 3 R'G'B' double +▂ ▃▂▁▁▂ ▃▃ ▃ ▃▃ ·▁▁▂▂▁ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▃▃▃▃ ▃▃ ▂▃ ▃▃ ▃▃ ▃▃ ── 4 R'G'B'A double +· ▂▃▁▂ ▁▁ ▁ ▁▁ ▂▃ ▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▁▁▁▁ ▁▁ ▃ ▁▁ ▁▁ ▁▁ ── 5 R'aG'aB'aA double +▁ ▁ ··· ▂▂ ▂ ▂▂ ·▁▁▁···▂▃▂ ▃ ▃ ▁▁·▁▂▁▁▁▂▁ ▂ ▂▂▂▂▂ ▂▂ ·▁ ▂▂ ▂▂ ▂▂ ── 6 R'G'B' u8 +▁ ▁▂ ·▁ ▂▂ ▂ ▂▂ ▁·▁▂·▁▁▂▃▂ ▃ ▃ ▁▁▁▂▁▁▂▁▂▁ ▂ ▂▂▂▂▂ ▂▂ ·▁ ▂▂ ▂▂ ▂▂ ── 7 R'G'B'A u8 +· ▁▁· · ▁▁ ▁ ▁▁ ·▁▁▂▂▁ ▁▂▁ ▂▃▂ ···▁▁ ▁·▁· ▁ ▁▁▁▁▁ ▁▁ ·· ▁▁ ▁▁ ▁▁ ── 8 RGBA float +▁ ▂▂▁▂ ▂▂ ▂ ▂▂ ▁▂▂▃▂· ▂▃▂ ▃ ▃ ▁▁·▁▁ ·▁▂▁ ▂ ▂▂▂▂▂ ▂▂ ▂▃ ▂▂ ▂▂ ▂▂ ── 9 RGB float + ──10 RGB half + ──11 RGBA half + ──12 RaGaBaA half + ──13 R'G'B' half + ──14 R'G'B'A half + ──15 R'aG'aB'aA half + ──16 RGB u15 + ──17 RGBA u15 + ──18 RaGaBaA u15 + ──19 R'G'B' u15 + ──20 R'G'B'A u15 + ──21 R'aG'aB'aA u15 + ──22 RGB u32 + ──23 RGBA u32 + ──24 RaGaBaA u32 + ──25 R'G'B' u32 + ──26 R'G'B'A u32 + ──27 R'aG'aB'aA u32 +· ▃▁▂▃▁▂ ▁ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃ ▃ ▃▁▁▁▁ ▁▁ ▃▂ ▁▁ ▁▁ ▁▁ ──28 Y double +· ▃▁▂▃▁▂ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃ ▃▂ ▃ ▃▁▁▁▁ ▁▁ ▂ ▁▁ ▁▁ ▁▁ ──29 YA double + ──30 YaA double + ──31 Y' double + ──32 Y'A double +· ▃▁▂▃▁▂ ▁▁ ▁▁ ▃▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▂▃▃▃ ▂▁▁▁▁ ▁▁ ▂ ▁▁ ▁▁ ▁▁ ──33 Y'aA double + ──34 YA half + ──35 YaA half + ──36 Y half + ──37 Y'A half + ──38 Y'aA half + ──39 Y' half + ──40 YA u15 + ──41 YaA u15 + ──42 Y u15 + ──43 Y'A u15 + ──44 Y'aA u15 + ──45 Y' u15 + ──46 YA u32 + ──47 YaA u32 + ──48 Y u32 + ──49 Y'A u32 + ──50 Y'aA u32 + ──51 Y' u32 +· ▃▁▃▃▁▂ ▁▁ ▁ ▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▁▁▁▁ ▁▁ ▃ ▁▁ ▁▁ ▁▁ ──52 Y'CbCr double +· ▃▁▂▃▁▂ ▁▁ ▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▁▁▁▁ ▁▁ ▃▂ ▁▁ ▁▁ ▁▁ ──53 Y'CbCrA double + ──54 Y'CbCr u8 +▁ ·▂▁··▁ ▂▂ ▃ ▂▂ ··▁▁· ▂▃▂ ▃ ▃ ▁▁▁▂▂ ▂▁▂▁ ▂ ▂▂▂▂▂ ▂▂ ▁▂ ▂▂ ▂▂ ▂▂ ──55 R'G'B'A float +▂ ▁▃▂▁▁▂ ▃▃ ▃ ▃▃ ·▁▁▁▁▃ ▃ ▃ ▃ ▂▂▂▃▂▂▃▂▃▂ ▃ ▃▃▃▃▃ ▃▃ ▂▂ ▃▃ ▃▃ ▃▃ ──56 R'G'B'A u16 +▂ ▁ ▂▁▁▂ ▃▃ ▃ ▃▃ · ··▁ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▃▃▃▃ ▃▃ ▂▁ ▃▃ ▃▃ ▃▃ ──57 R'aG'aB'aA float +▃ ▂ ▃▂▂▃ ▁▂ ·▂▂ ▃▃▃ ▃▃▃▃ ▃ ▃ ▃▁ ──58 R'aG'aB'aA u16 +▃ ▂ ▂▃ ▁▂· ▂▂ ▃▃▃ ▃▃▃▃ ▃ ▃ · ──59 R'aG'aB'aA u8 +▂ ▃▃·▁▁· ▃▃ ▃ ▃▃ ▂▃▃▃ ▃ ▃ ▃ ▃ ▂▂▁▂▂ ▁▂▃▂ ▃ ▃▃▃▃▃ ▃▃ ▁▂ ▃▃ ▃▃ ▃▃ ──60 R'G'B' float +▃ ·▁▂▁ ▃ ▃ ▁ ▃▃▂▃▃▃▂▃ ▃ ▃ ▁▂ ──61 R'G'B' u16 +▂ ▁▃▂▁▁▂ ▃▃ ▃ ▃▃ ·▁▁▂▂▁ ·· ▂ ·▁▁ ▂▂▂▃▃ ▃·▁▁ ▁ ▂▃▃▃▃ ▃▃ ▃▃ ▃▃ ▃▃ ▃▃ ──62 Y'A float +▃ ▂ ▃▂▃▃ ▁▂·▁▁▂ ▁ ▁ ▂·▃ ▃▃▃ ▃▃▃▃ ▃ ▃▂ ──63 Y'aA float +▃ ▂ ▁▂▂▁ ▁▂▁▃▂· · ▁ · ▃▃▂▃▃ ▂▁▁· ▂ ▁ ▂▃ ──64 Y' float +▃ ▂ ▃▂▂▃ ▃ ▁▂▂▃▂▂▂·▁ ▃ ·▂▂ ▃▃▃ ▃▃▃▁▂▂ ▂ ▃ ▃▃ ──65 Y'A u16 + ▃ ▃▃ ▂▃▁▂▃▃ ▁·▂ ▁ ▃▃▃ ▃ ──66 Y'aA u16 + ▃ ▂▃▃▂ ▂▃▂▃▃▁▃▁▁· ▂▃· ▃ ▃▂▂▁ ▃ ▂ ▃▂ ──67 Y' u16 +▁ ▂▂▃▂·▁ ▂▂ ▂ ▂▂ ▁▃▂▃▃▂▂·▁▁·▃ ▂▂ ▁▁▁▂▁▁▂·▁▁ ▁ ▂▂▂▂▂ ▂▂ ▃▃ ▂▂ ▃▂ ▂▂ ──68 Y'A u8 + ▃ ▃ ▂▃▁▂▃▃ ▁·▂ · ▃▃▃ ▃ ──69 Y'aA u8 +▁ ▃▂▂▃·▁ ▂▂ ▂ ▂▂ ▂▃▂▃▃▁▃▁▁·▃▃·▂ ▁▁▁▂▂▁▂▁▁· ▂ ▁▂▂▂▂ ▂▂ ▃▃ ▂▂ ▂▂ ▂▂ ──70 Y' u8 +▃ ▁▂▂▁ ▃ ▃ ▂· ▃▃▂▃▃ ▂▃ ▃ ▃ ▂▃ ──71 Y'CbCr float +▂ ▁▃▂▁▁▂ ▃▃ ▃ ▃ ·▁▁▂▂▁ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▃▃▃▃ ▃▃ ▂▃ ▃▃ ▃▃ ▃▃ ──72 Y'CbCrA float +▁ ▂▂▂▂·▁ ▂▂ ▂ ▂▂ ▁▂▂▃▂▂▂▂▃▂ ▃ ▃ ▁·▁▁▁▂▁▂▁ ▂ ▂▂▂▂▂ ▂▃ ▂▂ ▂▂ ▂▂ ▂▃ ──73 RGBA u16 +▁ ▂▂▃▂·▁ ▂▂ ▂ ▂▂ ▁▂▂▃▂▂▂▂▃▂ ▃ ▃ ·▂·▁·▁▂▁ ▂ ▂▂▂▂▂ ▂▂ ▃▂ ▃▂ ▂▂ ▂▂ ──74 RGBA u8 +▁ ▂▂▁▂·▁ ▂▂ ▂ ▂▂ ▁▂▂▃▃▂ ▂▃▂ ▃ ▃ ▁ ·· ▂▁▂▁ ▂ ▂▂▂▂▂ ▂▂ ▁▁ ▂▂ ▂▂ ▂▂ ──75 RaGaBaA float +▂ ▃▃▂▃▁▂ ▃▃ ▃ ▃▃ ▂▃▃▂▃▃▃▃ ▃ ▃ ▃ ▂▂ ·▂▃▂▃▂ ▃ ▃▃▃▃▃ ▃▃ ▂▂ ▃▃ ▃▃ ▃▃ ──76 RaGaBaA u16 +▂ ▃▃▂▃▁▂ ▃▃ ▃ ▃▃ ▂▃▃▂▃▃▃▃ ▃ ▃ ▃ ▂ · ▂ ▂▃▂ ▃ ▃▃▃▃▃ ▂▂ ▃▃ ▃▃ ▃▃ ──77 RaGaBaA u8 +▂ ▃▃▂▃▁· ▃▃ ▃ ▃▃ ▂▃▃▃▃▁▃▃ ▃ ▃ ▃ ▂▂▁▂ ·▂▃▂ ▃ ▃▃▃▃▃ ▃▃ ▃▃ ▃▃ ▃▃ ▃▃ ──78 RGB u16 +▁ ▂▂▂▃·· ▂▂ ▂ ▂▂ ▁▂▃▃▃▁▂▂▃▂ ▃ ▃ ▁··▁· ▁▂▁ ▂ ▂▂▂▂▂ ▂▂ ▃▃ ▂▂ ▂▂ ▂▂ ──79 RGB u8 +▁ ▂▂▃▂·▁ ▂ ▂ ▂▂ ▁▂▂▃▃▂ ·▂▁ ▃ ▁▃▂ ▁▁▁▂▂ ·· · ▁▂▂▂▂ ▂▂ ▁▃ ▂▂ ▂▂ ▂▂ ──80 YA float +▂ ▃▃▂▃▁▂ ▃▃ ▃ ▃▃ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂·▁▁ ▃ ▂ ▃ ▃▃▃▃▃ ▃▃ ▂ ▃▃ ▃▃ ▃▃ ──81 YaA float +▂ ▃▃▂▃▁· ▃ ▃ ▃▃ ▂▃▂▃▃▁ ▁▁· ▂▃▁ ▂▂▁▂▂ ▁· ▁ ·▃▃▃▃ ▃▃ ▃▃ ▃▃ ▃▃ ▃▃ ──82 Y float +▂ ▃▃▂▃▁▂ ▃▃ ▃ ▃▃ ▂▃▃▃▃▃▃▁▂▂ ▂▃▃ ▂▂▂▃▂▂▃·▁ · ▂▃▃▃▃ ▃▃ ▂▂ ▃▃ ▃▃ ▃▃ ──83 YA u16 +▃ ▃ ▂▃ ▃ ▂▃▃ ▃▃▁▂▃▃▃▃·▃ ▃ ▃ ──84 YaA u16 +▃ ▃▃▂▁ ▃ ▃ ▃▂ ▂▂▁ ▃ ▂ ▃▂▂▃▃▃▂▁▁· ▂ ▁ ▂▃ ──85 Y u16 +▁ ▃▂▃▃·▁ ▂▂ ▂ ▂▂ ▂▃▃▃▃▃▃▁▂▂ ▂▃▃ ▂▁▁▂▂▁▂·▁▁· ▂▂▂▂▂ ▂▂ ▃▃ ▂▂ ▂▂ ▂▂ ──86 YA u8 +▃ ▃ ▂▃ ▃ ▂▃▃ ▃▃▁▂▃▃▃▃·▃ · ▃ ▃▃ ──87 YaA u8 +▁ ▂▂▃▂·▁ ▂ ▂ ▂▂ ▃▂▃▃▃▂▂▂▂▁ ▃ ▂ ▂▁▁▃▂▃▂▁▁·▃ ·▂ ▂▂▂▂ ▂▂ ▃▃ ▂▂ ▂▂ ▂▂ ──88 Y u8 +· ▃▁▃▃▁▂ ▁▁ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▁▁▁ ▁▁ ▃ ▁▁ ▁▁ ▁▁ ──89 CIE Lab double +· ▃▁▂▃▁▂ ▁▁ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃ ▁▁ ▁▁ ▃▂ ▁▁ ▁▁ ▁▁ ──90 CIE Lab alpha double +· ▃▁▃▃▁▂ ▁▁ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▁ ▁ ▁▁ ▃ ▁▁ ▁▁ ▁▁ ──91 CIE LCH(ab) double +· ▃▁▂▃▁▂ ▁▁ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▁▁ ▁▁ ▃▂ ▁▁ ▁▁ ▁▁ ──92 CIE LCH(ab) alpha double + ──93 CIE Lab float + ──94 CIE Lab alpha float + ──95 CIE Lab u8 + ──96 CIE Lab u16 + ──97 CIE LCH(ab) float + ──98 CIE LCH(ab) alpha float +· ▃▁▂▃▁▂ ▁▁ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▁▁▁▁ ▁ ▂▂ ▁▁ ▁▁ ▁▁ ──99 HSVA double +· ▃▁▃▃▁▂ ▁▁ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▃▃▂ ▃ ▃▁▁▁▁ ▃ ▁▁ ▁▁ ▁▁ ──100 HSV double + ──101 HSVA float + ──102 HSV float + ──103 cairo-RGB24 + ──104 cairo-ARGB32 + ──105 cairo-A8 +· ▃▁▃▃▁▂ ▁▁ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▁▁▁▁ ▁▁ ▃ ▁ ▁▁ ▁▁ ──106 CMYK double +· ▃▁▃▃▁▂ ▁▁ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▁▁▁▁ ▁▁ ▃ ▁▁ ▁▁ ──107 CMY double + ──108 CMYK float + ──109 CMY float + ──110 CMYK u8 +· ▃▁▃▃▁▂ ▁▁ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▁▁▁▁ ▁▁ ▃ ▁▁ ▁ ▁▁ ──111 Y'CbCr709 double +· ▃▁▂▃▁▂ ▁▁ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▁▁▁▁ ▁▁ ▂▂ ▁▁ ▁▁ ──112 Y'CbCrA709 double + ──113 Y'CbCrA709 float + ──114 Y'CbCr709 float + ──115 B'aG'aR'aA u8 +· ▃▁▂▃▁▂ ▁▁ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▁▁▁▁ ▁▁ ▂▂ ▁▁ ▁▁ ▁ ──116 HSLA double +· ▃▁▃▃▁▂ ▁▁ ▁ ▁▁ ▂▃▃▃▃▃ ▃ ▃ ▃ ▃ ▂▂▂▃▃ ▃▂▃▂ ▃ ▃▁▁▁▁ ▁▁ ▃ ▁▁ ▁▁ ──117 HSL double + ──118 HSLA float + ──119 HSL float +|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +||||||||||11111111112222222222333333333344444444445555555555666666666677777777778888888888999999999900000000001111111111 +012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +total length: 7178 +total cost : 4640499 Environment @@ -1405,5 +2139,30 @@ Daniel Paredes García danipga at gmail.com Initial work to make babl threadsafe Rupert Weber gimp at leguanease.org Documentation and other improvements - -/babl-0.1.10 +Jehan jehan at girinstud.io + win32 portabilitiy +Sven Claussner + Update DOAP file +Alexander Larsson + Math optimizations +Nils Philippsen + code cleanups +Simon Budig + cleanups +Micheal Muré + portability fixes +Maxime Nicco + + HSV color model extension + +Teo Mazars + Color spaces/models in extensions +Daniel Sabo + Dead code elimination, general cleanups, +Michael Henning + Conversion fixes +Elle Stone + Verification and improvements to accuracy of color space + conversions. + +/babl-0.1.12 diff --git a/aclocal.m4 b/aclocal.m4 index cbd0176..a7afae4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, @@ -14,172 +14,12 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 1 (pkg-config-0.24) -# -# Copyright © 2004 Scott James Remnant . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) -m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi -fi[]dnl -])# PKG_PROG_PKG_CONFIG - -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -# only at the first occurence in configure.ac, so if the first place -# it's called might be skipped (such as if it is within an "if", you -# have to call PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_default([$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- -m4_define([_PKG_CONFIG], -[if test -n "$$1"; then - pkg_cv_[]$1="$$1" - elif test -n "$PKG_CONFIG"; then - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes ], - [pkg_failed=yes]) - else - pkg_failed=untried -fi[]dnl -])# _PKG_CONFIG - -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED - - -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - m4_default([$4], [AC_MSG_ERROR( -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT])[]dnl - ]) -elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .])[]dnl - ]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - $3 -fi[]dnl -])# PKG_CHECK_MODULES - # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # @@ -198,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.3], [], +m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -214,7 +54,7 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.3])dnl +[AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -1226,7 +1066,6 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([m4/introspection.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) diff --git a/babl/Makefile.am b/babl/Makefile.am index cefab57..4f59447 100644 --- a/babl/Makefile.am +++ b/babl/Makefile.am @@ -28,6 +28,7 @@ c_sources = \ babl-model.c \ babl-mutex.c \ babl-palette.c \ + babl-ref-pixels.c \ babl-sampling.c \ babl-sanity.c \ babl-type.c \ @@ -56,6 +57,7 @@ h_sources = \ babl-memory.h \ babl-model.h \ babl-mutex.h \ + babl-ref-pixels.h \ babl-sampling.h \ babl-type.h \ babl-types.h \ @@ -63,6 +65,7 @@ h_sources = \ library_includedir=$(includedir)/babl-$(BABL_API_VERSION)/babl libinc_hdrs = \ + babl-introspect.h \ babl-macros.h \ babl-types.h \ babl.h @@ -86,49 +89,5 @@ libbabl_@BABL_API_VERSION@_la_LDFLAGS= \ ${no_undefined} $(MATH_LIB) \ -version-info $(BABL_LIBRARY_VERSION) -# GObject Introspection --include $(INTROSPECTION_MAKEFILE) -INTROSPECTION_GIRS = -INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) -INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) - -if HAVE_INTROSPECTION -Babl-$(BABL_API_VERSION).gir: $(G_IR_SCANNER) $(library_include_HEADERS) $(c_sources) $(srcdir)/Makefile.am - $(INTROSPECTION_SCANNER) -v --namespace Babl --nsversion=$(BABL_API_VERSION) \ - --add-include-path=$(srcdir) --add-include-path=. \ - --library=babl-$(BABL_API_VERSION) \ - --libtool="$(LIBTOOL)" \ - --output $@ \ - -DBABL_IS_BEING_COMPILED \ - -I$(top_srcdir) \ - -I$(top_builddir) \ - $(addprefix $(srcdir)/, $(libinc_hdrs)) \ - $(addprefix $(builddir)/, $(libinc_generated_hdrs)) \ - $(addprefix $(srcdir)/, $(c_sources)) - -girdir = $(datadir)/gir-1.0 -gir_DATA = Babl-$(BABL_API_VERSION).gir - -typelibsdir = $(libdir)/girepository-1.0 -typelibs_DATA = Babl-$(BABL_API_VERSION).typelib - -%.typelib: %.gir - LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(INTROSPECTION_COMPILER) \ - --includedir=$(srcdir) \ - --includedir=$(top_builddir)/babl \ - $(G_IR_COMPILER_OPTS) \ - $< -o $@ - -if HAVE_VALA -babl-$(BABL_API_VERSION).vapi: Babl-$(BABL_API_VERSION).gir - $(VAPIGEN) --library=babl-$(BABL_API_VERSION) Babl-$(BABL_API_VERSION).gir - -vapidir=$(datadir)/vala/vapi -vapi_DATA = babl-$(BABL_API_VERSION).vapi - -endif # HAVE_VALA - -endif # HAVE_INTROSPECTION - -EXTRA_DIST = $(gir_DATA) -CLEANFILES = $(gir_DATA) $(typelibs_DATA) $(vapi_DATA) +EXTRA_DIST = babl-ref-pixels.inc +# CLEANFILES = diff --git a/babl/Makefile.in b/babl/Makefile.in index 2b89052..702685d 100644 --- a/babl/Makefile.in +++ b/babl/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -16,8 +16,24 @@ @SET_MAKE@ - VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -36,16 +52,16 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = babl DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/babl-version.h.in \ gettimeofday.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/introspection.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -79,8 +95,7 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" \ - "$(DESTDIR)$(typelibsdir)" "$(DESTDIR)$(vapidir)" \ +am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(library_includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libbabl_@BABL_API_VERSION@_la_DEPENDENCIES = base/libbase.la \ @@ -92,8 +107,8 @@ am__objects_2 = babl.lo babl-component.lo babl-conversion.lo \ babl-fish.lo babl-format.lo babl-hash-table.lo babl-image.lo \ babl-internal.lo babl-introspect.lo babl-list.lo \ babl-memory.lo babl-model.lo babl-mutex.lo babl-palette.lo \ - babl-sampling.lo babl-sanity.lo babl-type.lo babl-util.lo \ - babl-cpuaccel.lo babl-version.lo + babl-ref-pixels.lo babl-sampling.lo babl-sanity.lo \ + babl-type.lo babl-util.lo babl-cpuaccel.lo babl-version.lo am_libbabl_@BABL_API_VERSION@_la_OBJECTS = $(am__objects_1) \ $(am__objects_2) libbabl_@BABL_API_VERSION@_la_OBJECTS = \ @@ -140,7 +155,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive -DATA = $(gir_DATA) $(typelibs_DATA) $(vapi_DATA) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac HEADERS = $(library_include_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive @@ -222,14 +241,6 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ -INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ -INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ -INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ -INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ -INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ -INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ -INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -259,18 +270,15 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEP = @PATH_SEP@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ RSVG = @RSVG@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHREXT = @SHREXT@ +SSE2_EXTRA_CFLAGS = @SSE2_EXTRA_CFLAGS@ SSE_EXTRA_CFLAGS = @SSE_EXTRA_CFLAGS@ STRIP = @STRIP@ -VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ W3M = @W3M@ WEBSITE_HOST = @WEBSITE_HOST@ @@ -323,7 +331,11 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -351,6 +363,7 @@ c_sources = \ babl-model.c \ babl-mutex.c \ babl-palette.c \ + babl-ref-pixels.c \ babl-sampling.c \ babl-sanity.c \ babl-type.c \ @@ -379,6 +392,7 @@ h_sources = \ babl-memory.h \ babl-model.h \ babl-mutex.h \ + babl-ref-pixels.h \ babl-sampling.h \ babl-type.h \ babl-types.h \ @@ -386,6 +400,7 @@ h_sources = \ library_includedir = $(includedir)/babl-$(BABL_API_VERSION)/babl libinc_hdrs = \ + babl-introspect.h \ babl-macros.h \ babl-types.h \ babl.h @@ -411,17 +426,7 @@ libbabl_@BABL_API_VERSION@_la_LDFLAGS = \ ${no_undefined} $(MATH_LIB) \ -version-info $(BABL_LIBRARY_VERSION) -INTROSPECTION_GIRS = -INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) -INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) -@HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0 -@HAVE_INTROSPECTION_TRUE@gir_DATA = Babl-$(BABL_API_VERSION).gir -@HAVE_INTROSPECTION_TRUE@typelibsdir = $(libdir)/girepository-1.0 -@HAVE_INTROSPECTION_TRUE@typelibs_DATA = Babl-$(BABL_API_VERSION).typelib -@HAVE_INTROSPECTION_TRUE@@HAVE_VALA_TRUE@vapidir = $(datadir)/vala/vapi -@HAVE_INTROSPECTION_TRUE@@HAVE_VALA_TRUE@vapi_DATA = babl-$(BABL_API_VERSION).vapi -EXTRA_DIST = $(gir_DATA) -CLEANFILES = $(gir_DATA) $(typelibs_DATA) $(vapi_DATA) +EXTRA_DIST = babl-ref-pixels.inc all: all-recursive .SUFFIXES: @@ -460,7 +465,6 @@ babl-version.h: $(top_builddir)/config.status $(srcdir)/babl-version.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -468,6 +472,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } @@ -520,6 +526,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/babl-model.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/babl-mutex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/babl-palette.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/babl-ref-pixels.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/babl-sampling.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/babl-sanity.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/babl-type.Plo@am__quote@ @@ -553,64 +560,13 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -install-girDATA: $(gir_DATA) - @$(NORMAL_INSTALL) - test -z "$(girdir)" || $(MKDIR_P) "$(DESTDIR)$(girdir)" - @list='$(gir_DATA)'; test -n "$(girdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(girdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(girdir)" || exit $$?; \ - done - -uninstall-girDATA: - @$(NORMAL_UNINSTALL) - @list='$(gir_DATA)'; test -n "$(girdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(girdir)'; $(am__uninstall_files_from_dir) -install-typelibsDATA: $(typelibs_DATA) - @$(NORMAL_INSTALL) - test -z "$(typelibsdir)" || $(MKDIR_P) "$(DESTDIR)$(typelibsdir)" - @list='$(typelibs_DATA)'; test -n "$(typelibsdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(typelibsdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(typelibsdir)" || exit $$?; \ - done - -uninstall-typelibsDATA: - @$(NORMAL_UNINSTALL) - @list='$(typelibs_DATA)'; test -n "$(typelibsdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(typelibsdir)'; $(am__uninstall_files_from_dir) -install-vapiDATA: $(vapi_DATA) - @$(NORMAL_INSTALL) - test -z "$(vapidir)" || $(MKDIR_P) "$(DESTDIR)$(vapidir)" - @list='$(vapi_DATA)'; test -n "$(vapidir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(vapidir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(vapidir)" || exit $$?; \ - done - -uninstall-vapiDATA: - @$(NORMAL_UNINSTALL) - @list='$(vapi_DATA)'; test -n "$(vapidir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(vapidir)'; $(am__uninstall_files_from_dir) install-library_includeHEADERS: $(library_include_HEADERS) @$(NORMAL_INSTALL) - test -z "$(library_includedir)" || $(MKDIR_P) "$(DESTDIR)$(library_includedir)" @list='$(library_include_HEADERS)'; test -n "$(library_includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(library_includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(library_includedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -793,13 +749,10 @@ distdir: $(DISTFILES) done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -821,10 +774,10 @@ distdir: $(DISTFILES) done check-am: all-am check: check-recursive -all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) +all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(typelibsdir)" "$(DESTDIR)$(vapidir)" "$(DESTDIR)$(library_includedir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(library_includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive @@ -849,7 +802,6 @@ install-strip: mostlyclean-generic: clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -881,8 +833,7 @@ info: info-recursive info-am: -install-data-am: install-girDATA install-library_includeHEADERS \ - install-typelibsDATA install-vapiDATA +install-data-am: install-library_includeHEADERS install-dvi: install-dvi-recursive @@ -928,9 +879,8 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-girDATA uninstall-libLTLIBRARIES \ - uninstall-library_includeHEADERS uninstall-typelibsDATA \ - uninstall-vapiDATA +uninstall-am: uninstall-libLTLIBRARIES \ + uninstall-library_includeHEADERS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive @@ -942,44 +892,17 @@ uninstall-am: uninstall-girDATA uninstall-libLTLIBRARIES \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-girDATA install-html install-html-am \ - install-info install-info-am install-libLTLIBRARIES \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES \ install-library_includeHEADERS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ - install-typelibsDATA install-vapiDATA installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am uninstall-girDATA \ - uninstall-libLTLIBRARIES uninstall-library_includeHEADERS \ - uninstall-typelibsDATA uninstall-vapiDATA - - -# GObject Introspection --include $(INTROSPECTION_MAKEFILE) - -@HAVE_INTROSPECTION_TRUE@Babl-$(BABL_API_VERSION).gir: $(G_IR_SCANNER) $(library_include_HEADERS) $(c_sources) $(srcdir)/Makefile.am -@HAVE_INTROSPECTION_TRUE@ $(INTROSPECTION_SCANNER) -v --namespace Babl --nsversion=$(BABL_API_VERSION) \ -@HAVE_INTROSPECTION_TRUE@ --add-include-path=$(srcdir) --add-include-path=. \ -@HAVE_INTROSPECTION_TRUE@ --library=babl-$(BABL_API_VERSION) \ -@HAVE_INTROSPECTION_TRUE@ --libtool="$(LIBTOOL)" \ -@HAVE_INTROSPECTION_TRUE@ --output $@ \ -@HAVE_INTROSPECTION_TRUE@ -DBABL_IS_BEING_COMPILED \ -@HAVE_INTROSPECTION_TRUE@ -I$(top_srcdir) \ -@HAVE_INTROSPECTION_TRUE@ -I$(top_builddir) \ -@HAVE_INTROSPECTION_TRUE@ $(addprefix $(srcdir)/, $(libinc_hdrs)) \ -@HAVE_INTROSPECTION_TRUE@ $(addprefix $(builddir)/, $(libinc_generated_hdrs)) \ -@HAVE_INTROSPECTION_TRUE@ $(addprefix $(srcdir)/, $(c_sources)) - -@HAVE_INTROSPECTION_TRUE@%.typelib: %.gir -@HAVE_INTROSPECTION_TRUE@ LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(INTROSPECTION_COMPILER) \ -@HAVE_INTROSPECTION_TRUE@ --includedir=$(srcdir) \ -@HAVE_INTROSPECTION_TRUE@ --includedir=$(top_builddir)/babl \ -@HAVE_INTROSPECTION_TRUE@ $(G_IR_COMPILER_OPTS) \ -@HAVE_INTROSPECTION_TRUE@ $< -o $@ - -@HAVE_INTROSPECTION_TRUE@@HAVE_VALA_TRUE@babl-$(BABL_API_VERSION).vapi: Babl-$(BABL_API_VERSION).gir -@HAVE_INTROSPECTION_TRUE@@HAVE_VALA_TRUE@ $(VAPIGEN) --library=babl-$(BABL_API_VERSION) Babl-$(BABL_API_VERSION).gir + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-libLTLIBRARIES uninstall-library_includeHEADERS + +# CLEANFILES = # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/babl/babl-conversion.c b/babl/babl-conversion.c index 4f68aaa..37453e0 100644 --- a/babl/babl-conversion.c +++ b/babl/babl-conversion.c @@ -24,6 +24,7 @@ #define NEEDS_BABL_DB #include "babl-internal.h" #include "babl-db.h" +#include "babl-ref-pixels.h" static Babl * conversion_new (const char *name, @@ -429,28 +430,6 @@ babl_conversion_process (const Babl *babl, return n; } -#define test_pixels 128 - - -static double * -test_create (void) -{ - static double test[sizeof (double) * test_pixels * 4]; - int i; - static int done = 0; - - if (done) - return test; - - srandom (20050728); - - for (i = 0; i < test_pixels * 4; i++) - test [i] = (double) random () / RAND_MAX; - - done = 1; - return test; -} - long babl_conversion_cost (BablConversion *conversion) { @@ -479,7 +458,9 @@ babl_conversion_error (BablConversion *conversion) long ticks_start = 0; long ticks_end = 0; - double *test; + const int test_pixels = babl_get_num_conversion_test_pixels (); + const double *test = babl_get_conversion_test_pixels (); + void *source; void *destination; double *destination_rgba_double; @@ -521,9 +502,6 @@ babl_conversion_error (BablConversion *conversion) conversion->error = 0.000042; } - test = test_create (); - - source = babl_calloc (test_pixels, fmt_source->format.bytes_per_pixel); destination = babl_calloc (test_pixels, fmt_destination->format.bytes_per_pixel); ref_destination = babl_calloc (test_pixels, fmt_destination->format.bytes_per_pixel); diff --git a/babl/babl-cpuaccel.c b/babl/babl-cpuaccel.c index ee12fd6..3445cf6 100644 --- a/babl/babl-cpuaccel.c +++ b/babl/babl-cpuaccel.c @@ -490,6 +490,10 @@ cpu_accel (void) accel = arch_accel (); +#if defined(ARCH_X86_64) + accel |= BABL_CPU_ACCEL_X86_64; +#endif + return (BablCpuAccelFlags) accel; #else /* !HAVE_ACCEL */ diff --git a/babl/babl-cpuaccel.h b/babl/babl-cpuaccel.h index c95af91..e701e2a 100644 --- a/babl/babl-cpuaccel.h +++ b/babl/babl-cpuaccel.h @@ -32,7 +32,8 @@ typedef enum BABL_CPU_ACCEL_X86_SSE3 = 0x02000000, /* powerpc accelerations */ - BABL_CPU_ACCEL_PPC_ALTIVEC = 0x04000000 + BABL_CPU_ACCEL_PPC_ALTIVEC = 0x04000000, + BABL_CPU_ACCEL_X86_64 = 0x00100000 } BablCpuAccelFlags; diff --git a/babl/babl-extension.c b/babl/babl-extension.c index d021914..7626867 100644 --- a/babl/babl-extension.c +++ b/babl/babl-extension.c @@ -332,8 +332,10 @@ babl_extension_load_dir_list (const char *dir_list) case BABL_PATH_SEPARATOR: { char *expanded_path = expand_path (path); - babl_extension_load_dir (expanded_path); - babl_free (expanded_path); + if (expanded_path) { + babl_extension_load_dir (expanded_path); + babl_free (expanded_path); + } } dst = path; src++; diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index 7914e0c..5dc0601 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -19,18 +19,27 @@ #include "config.h" #include #include "babl-internal.h" +#include "babl-ref-pixels.h" #define BABL_LEGAL_ERROR 0.000001 #define BABL_MAX_COST_VALUE 2000000 #define BABL_HARD_MAX_PATH_LENGTH 8 #define BABL_MAX_NAME_LEN 1024 +#ifndef MIN +#define MIN(a, b) (((a) > (b)) ? (b) : (a)) +#endif + +#define NUM_TEST_PIXELS (babl_get_num_path_test_pixels ()) +#define MAX_BUFFER_SIZE 1024 /* XXX: reasonable size for this should be profiled */ + + int babl_in_fish_path = 0; typedef struct _FishPathInstrumentation { const Babl *fmt_rgba_double; - double *test; + int num_test_pixels; void *source; void *destination; void *ref_destination; @@ -64,10 +73,13 @@ get_path_instrumentation (FishPathInstrumentation *fpi, double *ref_cost, double *path_error); + static long process_conversion_path (BablList *path, const void *source_buffer, + int source_bpp, void *destination_buffer, + int dest_bpp, long n); static void @@ -76,9 +88,6 @@ get_conversion_path (PathContext *pc, int current_length, int max_length); -static double * -test_create (void); - static char * create_name (char *buf, const Babl *source, @@ -100,7 +109,7 @@ static double legal_error (void) env = getenv ("BABL_TOLERANCE"); if (env && env[0] != '\0') - error = atof (env); + error = babl_parse_double (env); else error = BABL_LEGAL_ERROR; return error; @@ -173,6 +182,10 @@ get_conversion_path (PathContext *pc, { FishPathInstrumentation fpi; memset (&fpi, 0, sizeof (fpi)); + + fpi.source = (Babl*) babl_list_get_first (pc->current_path)->conversion.source; + fpi.destination = pc->to_format; + get_path_instrumentation (&fpi, pc->current_path, &path_cost, &ref_cost, &path_error); if ((path_cost < ref_cost) && /* do not use paths that took longer to compute than reference */ @@ -323,9 +336,40 @@ babl_fish_path_process (Babl *babl, void *destination, long n) { + const Babl *babl_source = babl->fish.source; + const Babl *babl_dest = babl->fish.destination; + int source_bpp = 0; + int dest_bpp = 0; + + switch (babl_source->instance.class_type) + { + case BABL_FORMAT: + source_bpp = babl_source->format.bytes_per_pixel; + break; + case BABL_TYPE: + source_bpp = babl_source->type.bits / 8; + break; + default: + babl_log ("=eeek{%i}\n", babl_source->instance.class_type - BABL_MAGIC); + } + + switch (babl_dest->instance.class_type) + { + case BABL_FORMAT: + dest_bpp = babl_dest->format.bytes_per_pixel; + break; + case BABL_TYPE: + dest_bpp = babl_dest->type.bits / 8; + break; + default: + babl_log ("-eeek{%i}\n", babl_dest->instance.class_type - BABL_MAGIC); + } + return process_conversion_path (babl->fish_path.conversion_list, source, + source_bpp, destination, + dest_bpp, n); } @@ -392,13 +436,14 @@ babl_process (const Babl *cbabl, return 0; babl_assert (n > 0); - /* first check if it is a fish since that is out fast path */ + /* first check if it is a fish since that is our fast path */ if (babl->class_type >= BABL_FISH && babl->class_type <= BABL_FISH_PATH) { babl->fish.processings++; - return babl->fish.pixels += + babl->fish.pixels += babl_fish_process (babl, source, destination, n); + return n; } /* matches all conversion classes */ @@ -410,10 +455,22 @@ babl_process (const Babl *cbabl, return -1; } +#include + +#define BABL_ALIGN 16 +static void inline *align_16 (unsigned char *ret) +{ + int offset = BABL_ALIGN - ((uintptr_t) ret) % BABL_ALIGN; + ret = ret + offset; + return ret; +} + static long process_conversion_path (BablList *path, const void *source_buffer, + int source_bpp, void *destination_buffer, + int dest_bpp, long n) { int conversions = babl_list_size (path); @@ -427,86 +484,62 @@ process_conversion_path (BablList *path, } else { - void *aux1_buffer = babl_malloc (n * sizeof (double) * 5); - void *aux2_buffer = NULL; - void *swap_buffer = NULL; - int i; + long j; + + void *temp_buffer = align_16 (alloca (MIN(n, MAX_BUFFER_SIZE) * sizeof (double) * 5 + 16)); + void *temp_buffer2 = NULL; if (conversions > 2) { /* We'll need one more auxiliary buffer */ - aux2_buffer = babl_malloc (n * sizeof (double) * 5); + temp_buffer2 = align_16 (alloca (MIN(n, MAX_BUFFER_SIZE) * sizeof (double) * 5 + 16)); } - /* The first conversion goes from source_buffer to aux1_buffer */ - babl_conversion_process (babl_list_get_first (path), - source_buffer, - aux1_buffer, - n); - /* Process, if any, conversions between the first and the last - * conversion in the path, in a loop */ - for (i = 1; i < conversions - 1; i++) + + + for (j = 0; j < n; j+= MAX_BUFFER_SIZE) { - babl_conversion_process (path->items[i], + long c = MIN (n - j, MAX_BUFFER_SIZE); + int i; + + /* this is where the loop unrolling should happen */ + void *aux1_buffer = temp_buffer; + void *aux2_buffer = NULL; + void *swap_buffer = NULL; + aux2_buffer = temp_buffer2; + + /* The first conversion goes from source_buffer to aux1_buffer */ + babl_conversion_process (babl_list_get_first (path), + (void*)(((unsigned char*)source_buffer) + (j * source_bpp)), aux1_buffer, - aux2_buffer, - n); - /* Swap the auxiliary buffers */ - swap_buffer = aux1_buffer; - aux1_buffer = aux2_buffer; - aux2_buffer = swap_buffer; - } + c); - /* The last conversion goes from aux1_buffer to destination_buffer */ - babl_conversion_process (babl_list_get_last (path), - aux1_buffer, - destination_buffer, - n); + /* Process, if any, conversions between the first and the last + * conversion in the path, in a loop */ + for (i = 1; i < conversions - 1; i++) + { + babl_conversion_process (path->items[i], + aux1_buffer, + aux2_buffer, + c); + /* Swap the auxiliary buffers */ + swap_buffer = aux1_buffer; + aux1_buffer = aux2_buffer; + aux2_buffer = swap_buffer; + } - /* Free auxiliary buffers */ - if (aux1_buffer) - babl_free (aux1_buffer); - if (aux2_buffer) - babl_free (aux2_buffer); + /* The last conversion goes from aux1_buffer to destination_buffer */ + babl_conversion_process (babl_list_get_last (path), + aux1_buffer, + (void*)((unsigned char*)destination_buffer + (j * dest_bpp)), + c); + } } return n; } -#define NUM_TEST_PIXELS (256 + 16 + 16) - -static double * -test_create (void) -{ - static double test[sizeof (double) * NUM_TEST_PIXELS * 4]; - int i, j; - static int done = 0; - - if (done) - return test; - - /* There is no need to generate the test - * more times ... */ - - srandom (20050728); - - /* add 128 pixels in the valid range between 0.0 and 1.0 */ - for (i = 0; i < 256 * 4; i++) - test [i] = (double) random () / RAND_MAX; - - /* add 16 pixels between -1.0 and 0.0 */ - for (j = 0; j < 16 * 4; i++, j++) - test [i] = 0.0 - (double) random () / RAND_MAX; - - /* add 16 pixels between 1.0 and 2.0 */ - for (j = 0; j < 16 * 4; i++, j++) - test [i] = 1.0 + (double) random () / RAND_MAX; - - done = 1; - return test; -} - static void init_path_instrumentation (FishPathInstrumentation *fpi, Babl *fmt_source, @@ -515,6 +548,8 @@ init_path_instrumentation (FishPathInstrumentation *fpi, long ticks_start = 0; long ticks_end = 0; + const double *test_pixels = babl_get_path_test_pixels (); + if (!fpi->fmt_rgba_double) { fpi->fmt_rgba_double = babl_format_new ( @@ -527,8 +562,7 @@ init_path_instrumentation (FishPathInstrumentation *fpi, NULL); } - if (!fpi->test) - fpi->test = test_create (); // <- test_create utiliza var static dentro de la función + fpi->num_test_pixels = babl_get_num_path_test_pixels (); fpi->fish_rgba_to_source = babl_fish_reference (fpi->fmt_rgba_double, fmt_source); @@ -537,31 +571,31 @@ init_path_instrumentation (FishPathInstrumentation *fpi, fpi->fish_destination_to_rgba = babl_fish_reference (fmt_destination, fpi->fmt_rgba_double); - fpi->source = babl_calloc (NUM_TEST_PIXELS, + fpi->source = babl_calloc (fpi->num_test_pixels, fmt_source->format.bytes_per_pixel); - fpi->destination = babl_calloc (NUM_TEST_PIXELS, + fpi->destination = babl_calloc (fpi->num_test_pixels, fmt_destination->format.bytes_per_pixel); - fpi->ref_destination = babl_calloc (NUM_TEST_PIXELS, + fpi->ref_destination = babl_calloc (fpi->num_test_pixels, fmt_destination->format.bytes_per_pixel); - fpi->destination_rgba_double = babl_calloc (NUM_TEST_PIXELS, + fpi->destination_rgba_double = babl_calloc (fpi->num_test_pixels, fpi->fmt_rgba_double->format.bytes_per_pixel); - fpi->ref_destination_rgba_double = babl_calloc (NUM_TEST_PIXELS, + fpi->ref_destination_rgba_double = babl_calloc (fpi->num_test_pixels, fpi->fmt_rgba_double->format.bytes_per_pixel); /* create sourcebuffer from testbuffer in the correct format */ babl_process (fpi->fish_rgba_to_source, - fpi->test, fpi->source, NUM_TEST_PIXELS); + test_pixels, fpi->source, fpi->num_test_pixels); /* calculate the reference buffer of how it should be */ ticks_start = babl_ticks (); babl_process (fpi->fish_reference, - fpi->source, fpi->ref_destination, NUM_TEST_PIXELS); + fpi->source, fpi->ref_destination, fpi->num_test_pixels); ticks_end = babl_ticks (); fpi->reference_cost = babl_process_cost (ticks_start, ticks_end); /* transform the reference destination buffer to RGBA */ babl_process (fpi->fish_destination_to_rgba, - fpi->ref_destination, fpi->ref_destination_rgba_double, NUM_TEST_PIXELS); + fpi->ref_destination, fpi->ref_destination_rgba_double, fpi->num_test_pixels); } static void @@ -590,20 +624,48 @@ get_path_instrumentation (FishPathInstrumentation *fpi, long ticks_start = 0; long ticks_end = 0; + Babl *babl_source = fpi->source; + Babl *babl_destination = fpi->destination; + + int source_bpp = 0; + int dest_bpp = 0; + + switch (babl_source->instance.class_type) + { + case BABL_FORMAT: + source_bpp = babl_source->format.bytes_per_pixel; + break; + case BABL_TYPE: + source_bpp = babl_source->type.bits / 8; + break; + default: + babl_log ("=eeek{%i}\n", babl_source->instance.class_type - BABL_MAGIC); + } + + switch (babl_destination->instance.class_type) + { + case BABL_FORMAT: + dest_bpp = babl_destination->format.bytes_per_pixel; + break; + case BABL_TYPE: + dest_bpp = babl_destination->type.bits / 8; + break; + default: + babl_log ("-eeek{%i}\n", babl_destination->instance.class_type - BABL_MAGIC); + } + if (!fpi->init_instrumentation_done) { /* this initialization can be done only once since the * source and destination formats do not change during * the search */ - Babl *fmt_source = (Babl *) BABL (babl_list_get_first (path))->conversion.source; - Babl *fmt_destination = (Babl *) BABL (babl_list_get_last (path))->conversion.destination; - init_path_instrumentation (fpi, fmt_source, fmt_destination); + init_path_instrumentation (fpi, babl_source, babl_destination); fpi->init_instrumentation_done = 1; } /* calculate this path's view of what the result should be */ ticks_start = babl_ticks (); - process_conversion_path (path, fpi->source, fpi->destination, NUM_TEST_PIXELS); + process_conversion_path (path, fpi->source, source_bpp, fpi->destination, dest_bpp, fpi->num_test_pixels); ticks_end = babl_ticks (); *path_cost = babl_process_cost (ticks_start, ticks_end); @@ -611,20 +673,20 @@ get_path_instrumentation (FishPathInstrumentation *fpi, * for comparison with each other */ babl_process (fpi->fish_destination_to_rgba, - fpi->destination, fpi->destination_rgba_double, NUM_TEST_PIXELS); + fpi->destination, fpi->destination_rgba_double, fpi->num_test_pixels); *path_error = babl_rel_avg_error (fpi->destination_rgba_double, fpi->ref_destination_rgba_double, - NUM_TEST_PIXELS * 4); + fpi->num_test_pixels * 4); #if 0 fpi->fish_rgba_to_source->fish.processings--; fpi->fish_reference->fish.processings--; fpi->fish_destination_to_rgba->fish.processings -= 2; - fpi->fish_rgba_to_source->fish.pixels -= NUM_TEST_PIXELS; - fpi->fish_reference->fish.pixels -= NUM_TEST_PIXELS; - fpi->fish_destination_to_rgba->fish.pixels -= 2 * NUM_TEST_PIXELS; + fpi->fish_rgba_to_source->fish.pixels -= fpi->num_test_pixels; + fpi->fish_reference->fish.pixels -= fpi->num_test_pixels; + fpi->fish_destination_to_rgba->fish.pixels -= 2 * fpi->num_test_pixels; #endif *ref_cost = fpi->reference_cost; diff --git a/babl/babl-fish-reference.c b/babl/babl-fish-reference.c index b00d67d..4133e40 100644 --- a/babl/babl-fish-reference.c +++ b/babl/babl-fish-reference.c @@ -93,8 +93,7 @@ babl_fish_reference (const Babl *source, static void convert_to_double (BablFormat *source_fmt, - const BablImage *source, - char *source_buf, + const char *source_buf, char *source_double_buf, int n) { @@ -114,7 +113,7 @@ convert_to_double (BablFormat *source_fmt, dst_img->stride[0] = 0; - src_img->data[0] = source_buf; + src_img->data[0] = (char *)source_buf; src_img->type[0] = (BablType *) babl_type_from_id (BABL_DOUBLE); src_img->pitch[0] = source_fmt->bytes_per_pixel; src_img->stride[0] = 0; @@ -133,14 +132,14 @@ convert_to_double (BablFormat *source_fmt, { dst_img->data[0] = source_double_buf + (dst_img->type[0]->bits / 8) * j; + + babl_process (assert_conversion_find (src_img->type[0], + dst_img->type[0]), + src_img, dst_img, n); break; } } - babl_process ( - assert_conversion_find (src_img->type[0], dst_img->type[0]), - src_img, dst_img, - n); src_img->data[0] += src_img->type[0]->bits / 8; } babl_free (src_img); @@ -151,7 +150,6 @@ convert_to_double (BablFormat *source_fmt, static void convert_from_double (BablFormat *destination_fmt, char *destination_double_buf, - BablImage *destination, char *destination_buf, int n) { @@ -187,14 +185,14 @@ convert_from_double (BablFormat *destination_fmt, { src_img->data[0] = destination_double_buf + (src_img->type[0]->bits / 8) * j; + + babl_process (assert_conversion_find (src_img->type[0], + dst_img->type[0]), + src_img, dst_img, n); break; } } - babl_process ( - assert_conversion_find (src_img->type[0], dst_img->type[0]), - src_img, dst_img, - n); dst_img->data[0] += dst_img->type[0]->bits / 8; } babl_free (src_img); @@ -204,7 +202,6 @@ convert_from_double (BablFormat *destination_fmt, static void ncomponent_convert_to_double (BablFormat *source_fmt, - const BablImage *source, char *source_buf, char *source_double_buf, int n) @@ -221,7 +218,7 @@ ncomponent_convert_to_double (BablFormat *source_fmt, dst_img->pitch[0] = (dst_img->type[0]->bits / 8); dst_img->stride[0] = 0; - src_img->data[0] = source_buf; + src_img->data[0] = source_buf; src_img->type[0] = source_fmt->type[0]; src_img->pitch[0] = source_fmt->type[0]->bits / 8; src_img->stride[0] = 0; @@ -239,7 +236,6 @@ ncomponent_convert_to_double (BablFormat *source_fmt, static void ncomponent_convert_from_double (BablFormat *destination_fmt, char *destination_double_buf, - BablImage *destination, char *destination_buf, int n) { @@ -274,38 +270,67 @@ ncomponent_convert_from_double (BablFormat *destination_fmt, } - static int -process_same_model (const Babl *babl, - const BablImage *source, - BablImage *destination, - long n) +process_to_n_component (const Babl *babl, + const char *source, + char *destination, + long n) { void *double_buf; +#ifndef MAX +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#endif + int components = MAX(BABL (babl->fish.source)->format.model->components, + BABL (babl->fish.source)->format.components); + components = MAX(components, BABL (babl->fish.destination)->format.components); + components = MAX(components, BABL (babl->fish.destination)->model.components); + + double_buf = babl_malloc (sizeof (double) * n * components); + memset (double_buf, 0,sizeof (double) * n * components); - if (BABL_IS_BABL (source) || - BABL_IS_BABL (destination)) { - babl_log ("args=(%p, %p, %p, %li): trying to handle BablImage (unconfirmed code)", - babl_fish, source, destination, n); + ncomponent_convert_to_double ( + (BablFormat *) BABL (babl->fish.source), + (char *) source, + double_buf, + n + ); + + ncomponent_convert_from_double ( + (BablFormat *) BABL (babl->fish.destination), + double_buf, + (char *) destination, + n + ); } + babl_free (double_buf); + return 0; +} + + +static int +process_same_model (const Babl *babl, + const char *source, + char *destination, + long n) +{ + void *double_buf; +#define MAX(a, b) ((a) > (b) ? (a) : (b)) + double_buf = babl_malloc (sizeof (double) * n * - BABL (babl->fish.source)->format.components); + MAX (BABL (babl->fish.source)->format.model->components, + BABL (babl->fish.source)->format.components)); +#undef MAX - if ( - (BABL (babl->fish.source)->format.components == + if ((BABL (babl->fish.source)->format.components == BABL (babl->fish.destination)->format.components) && (BABL (babl->fish.source)->format.model->components != BABL (babl->fish.source)->format.components)) { - /* FIXME: should recursively invoke babl and look up an appropriate fish - * for the conversion and multiply n by the number of components. - */ ncomponent_convert_to_double ( (BablFormat *) BABL (babl->fish.source), - BABL_IS_BABL (source) ? source : NULL, - BABL_IS_BABL (source) ? NULL : (char *) source, + (char *) source, double_buf, n ); @@ -313,8 +338,7 @@ process_same_model (const Babl *babl, ncomponent_convert_from_double ( (BablFormat *) BABL (babl->fish.destination), double_buf, - BABL_IS_BABL (destination) ? destination : NULL, - BABL_IS_BABL (destination) ? NULL : (char *) destination, + (char *) destination, n ); } @@ -322,8 +346,7 @@ process_same_model (const Babl *babl, { convert_to_double ( (BablFormat *) BABL (babl->fish.source), - BABL_IS_BABL (source) ? source : NULL, - BABL_IS_BABL (source) ? NULL : (char *) source, + (char *) source, double_buf, n ); @@ -331,8 +354,7 @@ process_same_model (const Babl *babl, convert_from_double ( (BablFormat *) BABL (babl->fish.destination), double_buf, - BABL_IS_BABL (destination) ? destination : NULL, - BABL_IS_BABL (destination) ? NULL : (char *) destination, + (char *) destination, n ); } @@ -341,10 +363,10 @@ process_same_model (const Babl *babl, } long -babl_fish_reference_process (const Babl *babl, - const BablImage *source, - BablImage *destination, - long n) +babl_fish_reference_process (const Babl *babl, + const char *source, + char *destination, + long n) { void *source_double_buf; void *rgba_double_buf; @@ -357,14 +379,13 @@ babl_fish_reference_process (const Babl *babl, if (BABL (babl->fish.source)->format.model == BABL (babl->fish.destination)->format.model) return process_same_model (babl, source, destination, n); -#if 0 - if (BABL_IS_BABL (source) || - BABL_IS_BABL (destination)) - { - babl_log ("args=(%p, %p, %p, %li): trying to handle BablImage (unconfirmed code)", - babl_fish, source, destination, n); - } -#endif + + if (babl_format_is_format_n (BABL (babl->fish.destination))) + { + return process_to_n_component (babl, source, destination, n); + } + + source_double_buf = babl_malloc (sizeof (double) * n * BABL (babl->fish.source)->format.model->components); @@ -381,8 +402,7 @@ babl_fish_reference_process (const Babl *babl, convert_to_double ( (BablFormat *) BABL (babl->fish.source), - NULL, - (char *) source, + source, source_double_buf, n ); @@ -435,8 +455,7 @@ babl_fish_reference_process (const Babl *babl, convert_from_double ( (BablFormat *) BABL (babl->fish.destination), destination_double_buf, - NULL, - (char *) destination, + destination, n ); diff --git a/babl/babl-fish-stats.c b/babl/babl-fish-stats.c index ccd4037..c0b34de 100644 --- a/babl/babl-fish-stats.c +++ b/babl/babl-fish-stats.c @@ -252,7 +252,7 @@ static double legal_error (void) env = getenv ("BABL_TOLERANCE"); if (env && env[0] != '\0') - error = atof (env); + error = babl_parse_double (env); else error = BABL_LEGAL_ERROR; return error; @@ -308,7 +308,7 @@ babl_fish_stats (FILE *file) "\n" "\n" "BablFishPath introspection\n" - + "\n" "